package com.ymt.bpm.util;

import jodd.props.Props;

import java.io.IOException;

/**
 * Created by Johnny on 2017/4/11.
 */
public class Platform {

    private static Props p;

    static {
        p = new Props();
        try {
            p.load(Platform.class.getClassLoader()
                    .getResourceAsStream("settings.props"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getString(String key) {
        return p.getValue(key);
    }

    public static int getInt(String key) {
        return p.getIntegerValue(key);
    }

    public static boolean getBoolean(String key) {
        return p.getBooleanValue(key);
    }

    public static long getLong(String key) {
        return p.getLongValue(key);
    }

    public static String getString(String key, String profile) {
        return p.getValue(key, profile);
    }

    public static int getInt(String key, String profile) {
        return p.getIntegerValue(key, profile);
    }

    public static boolean getBoolean(String key, String profile) {
        return p.getBooleanValue(key, profile);
    }

    public static long getLong(String key, String profile) {
        return p.getLongValue(key, profile);
    }

}
